{% extends "base.html" %}

{% block title %}
    分类
{% endblock %}

{#重写内容块#}
{% block content %}
    <h3>以下是《{{ category }}》类别的文章:</h3>
    {% for article in page_obj.object_list %}
{#        显示文章的面板#}
        <div class="panel panel-default">
{#            面板的头部#}
             <div class="panel-heading">
{#                 标题内容#}
                 <h2 class="panel-title">
                     <a>{{ article.title }}</a>
                 </h2>
             </div>
{#            面板的主体#}
            <div class="panel-body">
                 <p>作者：{{ article.author }}  日期：{{ article.publish_time }}</p>
{#                truncatechars过滤器用户仅显示200字符#}
                 <p>{{ article.content|truncatechars:200 }}</p>
                <a class="btn" href="">进入阅读</a>
            </div>
        </div>
    {% endfor %}
{#    分页条#}
    {% include 'paginator.html' %}
{% endblock %}